package teaching.io.base;

import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * 字符输出流示例。
 * 
 * @author deng.zhao
 * @version 1.0 2018/03/28
 *
 */
public class WriterExample {

	public static void main(String[] args) {

		String str = "你好，世界。";

		try (Writer w = new FileWriter("d:/test.txt");) {
			w.write(str);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		System.out.println("DONE!");
	}

}
